package cn.tedu.rabbitmqboot.m1;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消费者自动启动，注册成为消费者，自动监听队列中的消息
 * 不需要手动调用
 */
@Component
public class Consumer {
    @RabbitListener(queues = "helloworld")
    public void recieve(String msg){
        System.out.println("收到："+msg);
    }
}
